package com.gexiaobao.pigeon.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.ListPigeon
import com.gexiaobao.pigeon.databinding.ItemPrintPigeonBinding

/**
 * @Author      : hxw
 * @Date        : 2024/7/10 13:59
 * @Describe    :
 */
class AdapterPrintVisitPigeon(data: ArrayList<ListPigeon>) :
    BaseQuickAdapter<ListPigeon, DataBindBaseViewHolder>(R.layout.item_print_pigeon, data) {
    override fun convert(holder: DataBindBaseViewHolder, item: ListPigeon) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemPrintPigeonBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        holder.setText(R.id.tvItemPrintVisitNo, (holder.layoutPosition + 1).toString())
    }
}